home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4751 < prev    next >
Encoding:
Text File  |  1996-08-06  |  631 b   |  34 lines

  1. Path: arapaho.cse.ucsc.edu!ray
  2. From: ray@cse.ucsc.edu (Ray Swartz)
  3. Newsgroups: comp.lang.c++
  4. Subject: Derived->Base a Signature match?
  5. Date: 1 Feb 1996 00:04:53 GMT
  6. Organization: UC Santa Cruz CIS/CE
  7. Message-ID: <4ep035$kdp@darkstar.UCSC.EDU>
  8. NNTP-Posting-Host: arapaho.cse.ucsc.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. If 
  12.  
  13. class Base {
  14. public:
  15.    int operator+(const Base&) {...}
  16.    ...
  17. };
  18.  
  19. class Derived : public Base { 
  20. // no operator+
  21. ...
  22. };
  23.  
  24. then
  25.  
  26.      Derived d;
  27.      Base b;
  28.  
  29.      b = b + d;  // is d converted to b by signature match (user-defined
  30.          // conversion) or is it an exact match due 
  31.          // to language rules?
  32.  
  33.  
  34.